//
//  HomeLayoutModel.swift
//  Employee
//
//  Created by swordjoy on 2017/4/26.
//  Copyright © 2017年 remotevillage. All rights reserved.
//

import Foundation
import SwiftyJSON

struct HomeLayoutModel {
  
    var isData: Bool {
        if apply == false && order == false && inspection == false && readingMeter == false { return false }
        return true
    }
    
    let inspection: Bool
    let order: Bool
    let apply: Bool
    let readingMeter: Bool
    
    init(json: JSON) {
        inspection = json["inspectionRecord"].boolValue
        order = json["workOrder"].boolValue
        apply = json["apply"].boolValue
        readingMeter = json["meter"].boolValue
    }
  
//  var layoutCode: Int {
//    
//    if order && inspection {
//      return 3
//    } else if order && !inspection {
//      return 1
//    } else if !order && inspection {
//      return 2
//    } else {
//      return 4
//    }
//    
//  }
  
}
